/*
 * SEMIDRIVE Copyright Statement
 * Copyright (c) SEMIDRIVE. All rights reserved
 *
 * This software and all rights therein are owned by SEMIDRIVE, and are
 * protected by copyright law and other relevant laws, regulations and
 * protection. Without SEMIDRIVE's prior written consent and/or related rights,
 * please do not use this software or any potion thereof in any form or by any
 * means. You may not reproduce, modify or distribute this software except in
 * compliance with the License. Unless required by applicable law or agreed to
 * in writing, software distributed under the License is distributed on
 * an "AS IS" basis, WITHOUT WARRANTIES OF ANY KIND, either express or implied.
 *
 * You should have received a copy of the License along with this program.
 * If not, see <http://www.semidrive.com/licenses/>.
 */

/**
 * @file  Can_Cfg.h
 * @brief Semidrive. AUTOSAR 4.3.1 MCAL Can Driver.
 * @date 2025-06-04 10:43:19
 */

#ifndef CAN_CFG_H_
#define CAN_CFG_H_

#ifdef __cplusplus
extern "C"{
#endif

/* Version and Check Begin */
/* Version Info Begin */
#define CAN_CFG_H_VENDOR_ID    0x8C
#define CAN_CFG_H_AR_RELEASE_MAJOR_VERSION    4
#define CAN_CFG_H_AR_RELEASE_MINOR_VERSION    3
#define CAN_CFG_H_AR_RELEASE_REVISION_VERSION 1
#define CAN_CFG_H_SW_MAJOR_VERSION    1
#define CAN_CFG_H_SW_MINOR_VERSION    0
#define CAN_CFG_H_SW_PATCH_VERSION    0
/* Version Info End */
/* Version and Check End */


/**
 * @brief Specify whether pre-compile is supported.
 */
 #define CAN_PRECOMPILE_SUPPORT     (STD_OFF)

/**
 * @brief specific the AUTOSAR CAN driver version
 *
 */
#define AUTOSAR_VERSION_431 1u

/**
 * @brief Switches the development error detection and notification on or off.
 */
#define CAN_DEV_ERROR_DETECT     (STD_ON)

/**
 * @brief Instance number of the driver, used by Det_ReportError.
 */
#define CAN_INSTANCE (0U)

/**
 * @brief Period for cyclic call to Can_MainFunction_Mode. Unit is millisecond.
 */
#define CAN_MAIN_FUNCTION_MODE_PERIOD (10U)

/**
 * @brief Specifies if multiplexed transmission shall be supported.
 */
#define CAN_MULTIPLEXED_TRANSMISSION     (STD_ON)

/**
 * @brief Specify the maximum time for blocking function until a timeout is detected.
 * Unit is microsecond.
 */
#define CAN_TIMEOUT_DURATION (1000000U)

/**
 * @brief low power/freeze mode regiter operator counter.
 */
#define FLEXCAN_TIMEOUT_CNT (1000000U)

/**
 * @brief Switches the Can_GetVersionInfo() API ON or OFF.
 */
#define CAN_VERSION_INFO_API     (STD_OFF)

/**
 * @brief The period of cyclic call to Can_MainFunction_Busoff.
 * Unit is milliseconds.
 */

/**
 * @brief The period of cyclic call to Can_MainFunction_Wakeup.
 * Unit is milliseconds.
 */

/**
 * @brief Support of Can_SetBaudrate API.
 */
#define CAN_SET_BAUDRATE_API (STD_ON)
/**
 * @brief Specify whether multiple read period is supported or not.
 */
#define CAN_MULTIPLE_READ_PERIOD (STD_OFF)

/**
 * @brief Specify whether multiple write period is supported or not.
 */
#define CAN_MULTIPLE_WRITE_PERIOD (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 0 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_0 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 1 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_1 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 2 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_2 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 3 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_3 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 4 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_4 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 5 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_5 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 6 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_6 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 7 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_7 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 8 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_8 (STD_OFF)

/**
 * @brief Specify whether Rx/Tx polling period 9 is supported or not.
 */
#define CAN_MAINFUNCTION_RW_PERIOD_9 (STD_OFF)

/**
 * @brief Support of Can_CheckWakeup API.
 */
#define CAN_CHECK_WAKEUP_API (STD_OFF)

/**
 * @brief Support of trigger-transmit.
 */
#define CAN_TRIGGER_TRANSMIT_EN (STD_OFF)

/**
 * @brief The number of CAN controller configured.
 */
#define CAN_CONTROLLER_COUNT (2U)

/**
 * @brief The number of VCAN controller configured.
 */
#define VCAN_CONTROLLER_COUNT (0U)

/**
 * @brief The number of VCAN controller configured.
 */
#define CAN_VCAN_TOTAL_CONTROLLER_COUNT (2U)

/**
 * @brief Specify whether used vcan.
 */
#define VCAN_ENABLE     (STD_OFF)

/**
 * @brief Specify whether CAN driver should support CAN FD.
 */

#define CAN_FD_SUPPORT  (STD_ON)

/**
 * @brief Specify whether CAN driver should support Enhanced FIFO.
 */
#define CAN_ENHANCED_FIFO_SUPPORT   (STD_OFF)

/** \brief  Total Number of Core  Supported */
#define CAN_CFG_CORE_NUM_MAX   (4U)


/**
 *  \name PWM controller(s) assigned core
 *  \{
 */
/** \brief  Whether PWM controller(s) is assigned to core0  */
#define CAN_CFG_ENABLE_CORE0            (STD_ON)
/** \brief  Whether PWM controller(s) is assigned to core1  */
#define CAN_CFG_ENABLE_CORE1            (STD_ON)
/** \brief  Whether PWM controller(s) is assigned to core2  */
#define CAN_CFG_ENABLE_CORE2            (STD_OFF)
/** \brief  Whether PWM controller(s) is assigned to core3  */
#define CAN_CFG_ENABLE_CORE3            (STD_OFF)
/** \} */

/**
 * @brief The definition of HOHs.
 */
#define Rout_Can2ToCan1_100ms_CAN2 0U
#define Host_CAN2_NM 1U
#define Host_TransMsg2_20ms_CAN2 2U
#define Host_TransMsg1_20ms_CAN2 3U
#define Host_SYNCTime_500ms 4U
#define Host_TransMsg1_20ms 5U
#define Rout_Can1ToCan2_100ms 6U
#define XCP_Req 7U
#define Host_TransMsg2_20ms 8U
#define Host_CAN1_NM 9U
#define UDS_DiagFuncReq 10U
#define UDS_DiagPhyReq 11U
#define Rout_Can1ToCan2_100ms_CAN2 12U
#define EcuDemo_TransMsg1_10ms_CAN2 13U
#define EcuDemo_TransMsg2_100ms_CAN2 14U
#define EcuDemo_TransMsg3_Event_CAN2 15U
#define EcuDemo_CAN2_NM 16U
#define EcuDemo_SYNCTime_500ms 17U
#define EcuDemo_TransMsg2_100ms 18U
#define EcuDemo_CAN1_NM 19U
#define EcuDemo_TransMsg3_Event 20U
#define XCP_Resp 21U
#define EcuDemo_TransMsg1_10ms 22U
#define Rout_Can2ToCan1_100ms 23U
#define UDS_DiagResp 24U

#define CAN_HOH_MAX 25U

/**
 * @brief The first HTH configuration index.
 */
#define FIRST_HTH_INDEX (13U)

/**
 * @brief The number of all Rx and Tx MBs.
 */
#define CAN_MB_COUNT (25U)

/**
 * @brief The number of VCAN Rx and Tx MBs.
 */
#define VCAN_MB_COUNT (0U)

/**
 * @brief The number of CAN and VCAN Rx and Tx MBs.
 */
#define CAN_VCAN_TOTAL_MB_COUNT (25U)

/**
 * @brief The number of all Rx FIFOs.
 */
#define CAN_RX_FIFO_COUNT (0U)

/**
 * @brief Specify whether CAN driver should support Legacy FIFO.
 */
#define CAN_RXFIFO_SUPPORT  (STD_OFF)

/**
 * @brief Specify Can Controller index.
 */
#define CanConf_CanController_CANFD3 0U
#define CanConf_CanController_CANFD1 1U




#ifdef __cplusplus
}
#endif

#endif /* CAN_CFG_H_ */
